package org.example.day;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/06/07 19:38
 */
public class Solution038 {

    public static void main(String[] args) {
        Solution038 solution = new Solution038();
        System.out.println(solution.maxOperations(new int[]{3,2,1,4,5}));
    }

    public int maxOperations(int[] nums) {
        int count = 0;

        int fen = nums[0] + nums[1];

        for(int i=0;i<nums.length - 1; i+=2){
            if(fen == (nums[i] + nums[i+1])){
                count++;
            }else {
                break;
            }
        }

        return count;

    }

}
